<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>注册页面</title>
	<script src='js/jquery1.42.min.js'></script>
	<style>
		.reg_span1{font-size: 20px;color:#ac0000;font-weight: bold;padding: 0 8px;}
	</style>

	<script>
	window.onload=function(){
		var duihao=document.getElementById("duihao");
		var name=document.getElementById("name");
		var span_name=document.getElementById("span_name");
		var td_name=document.getElementById("td_name");
		name.onfocus=function(){
			name.style.background="#ac0000";  
		}
		name.onblur=function(){
			name.style.background="#666666"; 
			var reg = /^[a-zA-Z]\w{5,18}$/; 
			var stat = reg.test(name.value);
			if (stat) {
				td_name.removeChild(span_name);
				td_name.appendChild(duihao);
				duihao.style.display='inline-block';
				duihao.style.width='26px';
				duihao.style.height='26px';
				duihao.style.background="url(images/duihao.png) no-repeat";
			}else{
				// td_name.removeChild(span_name);
				td_name.insertBefore(duihao,span_name);
				duihao.style.display='inline-block';
				duihao.style.width='26px';
				duihao.style.height='26px';
				duihao.style.background="url(images/cuohao.png) no-repeat";
			};
			
			
		}
		
		
	}
	</script>
</head>
<body>




<div class="reg">
	<form action="" method="post">
		<table class="table">
		<span id='duihao'></span>
			<tr>
				<td>用户名：</td>
				<td id="td_name"><input id="name" type="text" name="name" /><span id='span_name'><span class='reg_span1'>*</span><span>请填写6到20个字符，必须以字母开头</span></span></td>
			</tr>
			<tr>
				<td>密码：</td>
				<td><input type="password" name="pwd" /><span class='reg_span1'>*</span><span>请填写6到20个字符，只能是字母、数字和下划线</span></td>
			</tr>
			<tr>
				<td>确认密码：</td>
				<td><input type="password" name="repwd" /><span class='reg_span1'>*</span><span>请填写6到20个字符，只能是字母、数字和下划线</span></td>
			</tr>
			<tr>
				<td>密码备忘提示信息：</td>
				<td><input type="text" name="tip" /><span>密码忘记的时候可以查看密码备忘提示</span></td>
			</tr>
			<tr>
				<td>手机号：</td>
				<td><input type="text" name="tel" /></td>
			</tr>
			<tr>
				<td>邮箱：</td>
				<td><input type="text" name="email" /><span class='reg_span1'>*</span><span></span></td>
			</tr>
			<tr>
				<td>qq：</td>
				<td><input type="text" name="qq" /> <input name="email" disabled="disabled" /></td>
			</tr>
			<tr>
				<td>验证码：</td>
				<td><input type="text" autocomplete="off"  name="seccodeverify">
				<a class="reloadverify" title="换一张" href="javascript:void(0)">换一张？</a>
				<span class="Validform_checktip Validform_wrong">请填写验证码</span>
				<br>
				<img class="verifyimg reloadverify" alt="点击切换" src="#"><span class='reg_span1'>*</span><span></span></td>
			</tr>
			<tr><td colspan="2"><input type="submit" value="提交" /></td></tr>
		</table>
	</form>
</div>
	
</body>
</html>